package Bondarenko.algorithm.calc;

//Array + array operation = string

public class RetString {
	
	 public static String retString (int[] array2, Operation[] array ){
		
		 String[] stringArray = new String[ array2.length + array.length];
		 
		 int y = 0;
		 int z = 0;
		 for(int j = 0; j <  array2.length + array.length ; j+=2){	
				stringArray[j] =  Integer.toString(array2[z]);
				
			 if (j<array2.length + array.length -2 ){
       		 if (array[y] == Operation.PLUS) stringArray[j+1] = "+";
       		 if (array[y] == Operation.MINUS) stringArray[j+1] = "-";
       		 if (array[y] == Operation.MULTIPLY) stringArray[j+1] = "*";
       		 if (array[y] == Operation.DIVIDE) stringArray[j+1] = "/";
       		if (y<array.length) y++;
       		 }
			 z++;
			}

		 String s=stringArray[0];
		 for(int j = 1; j <  array2.length + array.length; j++)
		 { s += stringArray[j];}
		 
		 return s;
		 
	 }

}